Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the normalization logic to simplify view definition processing by consolidating the approach around a custom formatter. Since both desired and current states now come from database inspection (embedded-postgres), the PR removes legacy parser-specific code and focuses on minimal, formatter-based transformations.
Key changes:
- Replaces AST-based normalization with a streamlined custom formatter approach
- Removes unused functions for table qualifier removal and expression fingerprinting
- Consolidates "= ANY (ARRAY[...])" to "IN (...)" conversion into the custom formatter
Reviewed Changes
Copilot reviewed 35 out of 36 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/diff/online/alter_constraint/* | Updated test expectations to include explicit type casts (::pg_catalog.numeric) in constraint definitions |
| testdata/diff/online/add_constraint/* | Updated test expectations to include explicit type casts in constraint definitions |
| testdata/diff/migrate/v*/plan.json | Updated source fingerprint hashes to reflect changes in normalization output |
| testdata/diff/create_view/alter_view/* | Updated view definition formatting including explicit type casts, parenthesized ORDER BY expressions, and adjusted whitespace |
| testdata/diff/create_view/add_view_coalesce/* | Removed entire test case files (old.sql, new.sql, diff.sql, plan.* files) |
| testdata/diff/create_view/add_view_array_operators/* | Removed entire test case files |
| testdata/diff/create_view/add_view/* | Replaced employee_department_view test with array_operators_view and text_search_view tests |
| ir/normalize.go | Major refactoring: removed legacy normalization functions, simplified view definition processing, consolidated formatter usage |
| ir/formatter.go | Added newline formatting to CASE expressions for improved readability |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cea8369 to
611bf42
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
No description provided.